/*首页逻辑代码
-------------------------------------------------------------------------*/


/*视频模态框部分
--------------------------------------------------------------------*/

//获取产品视频区每一项
var aSectionVideoA = document.querySelectorAll(".section-video a");

//获取视频模态框最外层元素
var oProductVideoBg = document.querySelector(".product-video-bg");

for (let i = 0;i < aSectionVideoA.length;i ++) {
    aSectionVideoA[i].onclick = function (params) {
        document.body.className = "modal-open";
        Velocity(oProductVideoBg, {
            display: 'block',
            opacity: 1,
            top: 0
        })
        
    }
}

//获取视频模态框中的关闭按钮
var videoCloseBtn = document.querySelector(".video-close-btn");

var oVideoMain = document.querySelector(".video-main");

videoCloseBtn.onclick = function (params) {
    document.body.className = "";
    Velocity(oProductVideoBg, {
        display: 'none',
        top: "-80px",
        opacity: 0       
    })

    if (!oVideoMain.paused) {
        oVideoMain.pause();
    }
    
}